<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>酒店设置</title>
<link href="<{$ipath}>user/style/my_service_css.css" type="text/css" rel="stylesheet">
<link href="<{$ipath}>user/style/my_account_css.css" type="text/css" rel="stylesheet">
<style>
.div_01{vertical-align:middle;}
.uploadimg{background:url(<{$ipath}>app/hotel/img/btn_upload.png) no-repeat;height:28px;width:58px;display:inline-block;}
.uploadimg input{opacity:0;filter:alpha(opacity=0);width:58px;height:28px;}
</style>
<script src="<{$ipath}>public/js/jquery.js"></script>
<script src="<{$ipath}>artDialog/jquery.artDialog.js?skin=default"></script>
<script src="<{$ipath}>artDialog/plugins/iframeTools.js"></script>
<script src="<{$ipath}>user/js/region_select.js"></script>
<script type="text/javascript"  src="<{$ipath}>wx/js/ajaxfileupload.js"></script>
<script src="<{$baseurl}>lib/kdeditor/kindeditor.js" type="text/javascript"></script>
<script src="<{$baseurl}>lib/kdeditor/lang/zh_CN.js" type="text/javascript"></script>
<script src="<{$baseurl}>lib/kdeditor/plugins/code/prettify.js" type="text/javascript"></script>
<script>

var K=window.KindEditor;
$(document).ready(function(e) {
		$(".button_shangchuan01").click(function(){
			$(".input_file01").click();
			});
		$(".button_shangchuan02").click(function(){
			$(".input_file02").click();
			});
		$(".button_shangchuan03").click(function(){
			$(".input_file03").click();
			});
		$(".button_shangchuan04").click(function(){
			$(".input_file04").click();
			});
		/*保存按钮*/
		$(".baocun").mouseover(function(){
			$(this).addClass("add_baocun")
			})
			$(".baocun").mouseleave(function(){
			$(this).removeClass("add_baocun")
			});
			
			/*弹出框隐藏显示*/
			/*$(".tupiankuang").hide();*/
			$(".yulan").click(function(){
				var imgurl = $("#logourl"+$(this).attr("data-id")).val();
				$("#yulanimg").attr("src",imgurl);
				$(".tupiankuang").show();
				});
			$(".x").mousemove(function(){
				$(this).attr("src","<{$ipath}>user/images/x_02.png")
				})
				$(".x").mouseleave(function(){
				$(this).attr("src","<{$ipath}>user/images/x_01.png")
				})
				$(".x").click(function(){
				$(".tupiankuang").hide();
				});
    });
function setlatlng(longitude,latitude){
            art.dialog.data('longitude', longitude);
            art.dialog.data('latitude', latitude);
            // 此时 iframeA.html 页面可以使用 art.dialog.data('test') 获取到数据，如：
            // document.getElementById('aInput').value = art.dialog.data('test');
            art.dialog.open('/?g=user&m=member&a=setLatLng_amap',{lock:false,title:'设置经纬度',width:600,height:400,yesText:'关闭',background: '#000',opacity: 0.87});
        }

        $(function(){
            new PCAS("province","city","district","<{if $info|@count neq 0 }><{$info.province}><{/if}>","<{if $info|@count neq 0 }><{$info.city}><{/if}>","<{if $info|@count neq 0 }><{$info.district}><{/if}>");
        });
		
		
</script>
</head>

<body>
<!--图片弹框-->
<div class="tupiankuang" style="display:none;">
	<!--<i class="x"></i>-->
    <img src="<{$ipath}>user/images/x_01.png" class="x">
	<div class="weizhi">
    	<img id="yulanimg" src="" class="weizi_img">
    </div>
</div>
<!--图片弹框-->
<div class="servicebox">
    <!--内容-->
    <div class="content01">
    	<div class="caibox">
    	<p class="title">酒店设置</p>
        <div class="content_merchant hotel_border">
            <!--表单部分-->
            <div class="hide_content">
            	<div class="company_01">
                <form class="form_set_up hotel_set_up" action="?&m=manage&a=setBaseInfo" method="post" target="hiddfrm" onSubmit="return checkfrm()">
                    <!--商户id-->
                    <!--复制-->
                    <div class="div_01">
                        <span><span class="red">*</span>酒店名称</span>
                        <input type="text" name="name" id="name" class="div_input" value="<{$info.name}>" >
                    </div>
                    <!--复制-->
                    <div class="div_01">
                        <span><span class="red">*</span>英文名称</span>
                        <input type="text" id="ename" name="ename" class="div_input" value="<{$info.ename}>" >
                    </div>
                    <!--复制-->
                    <div class="div_01">
                        <span>联系人</span>
                        <input type="text" name="person" class="div_input" value="<{$info.person}>" >
                    </div>
                    <!--复制-->
                    <div class="div_01">
                        <span><span class="red">*</span>联系电话</span>
                        <input type="text" id="tel" name="tel" class="div_input" value="<{$info.tel}>" >
                    </div>
                    <!--复制-->
                    <div class="div_01">
                        <span>手机</span>
                        <input type="text" name="phone" class="div_input" value="<{$info.phone}>" >
                    </div>
                    <!--复制-->
                    <div class="div_01">
                            <span>所在地</span>
                            <select name="province"></select>
                            <select name="city"></select>
                            <select name="district"></select>
                        </div>
                    <!--复制-->
                    <div class="div_01">
                        <span><span class="red">*</span>具体地址</span>
                        <input type="text" id="address" name="address" class="div_input" value="<{$info.address}>" >
                    </div>
                    <{if !empty($info.id)}>
                    <div class="div_01">
                        <span><span class="red">*</span>预览地址</span>
                        <img src="<{$info.rcode}>" height="80" /> <{$info.url}>
                    </div>
                    <{/if}>
                    <!--复制-->
                    <div class="div_01">
                        <span>酒店LOGO</span>
                        <input type="text" name="logourl" id="logourl4" value="<{$info.logo}>" class="div_input div_input02" >
                        <!--<input type="button" value="上传" class="div_file01 button_shangchuan04">-->
                        <!--隐藏-->
                        <div class="uploadimg"><input type="file" class="input_file04" name="uploadimg" id="uploadimg4" onchange="uploadimgs(4)"></div>
                        <input type="button" value="预览" data-id="4" class="div_file01 yulan">
                    </div>
                    <!--复制-->
                    <div class="div_01">
                        <span>首页轮播图1</span>
                        <input type="text" name="pic[]" id="logourl1" value="<{$info.pic.0}>" class="div_input div_input02" >
                        <!--<input type="button" value="上传" class="div_file01 button_shangchuan01">-->
                        <!--隐藏-->
                        <div class="uploadimg"><input type="file" class="input_file01" name="uploadimg" id="uploadimg1" onchange="uploadimgs(1)"></div>
                        <input type="button" value="预览" data-id="1" class="div_file01 yulan">
                    </div>
                    <!--复制-->
                    <div class="div_01">
                        <span>首页轮播图2</span>
                        <input type="text" name="pic[]" id="logourl2" value="<{$info.pic.1}>" class="div_input div_input02" >
                        <!--<input type="button" value="上传" class="div_file01 button_shangchuan02">-->
                        <!--隐藏-->
                        <div class="uploadimg"><input type="file" class="input_file02" name="uploadimg"  id="uploadimg2"  onchange="uploadimgs(2)"></div>
                        <input type="button" value="预览" data-id="2" class="div_file01 yulan">
                    </div>
                    <!--复制-->
                    <div class="div_01">
                        <span>首页轮播图3</span>
                        <input type="text" name="pic[]" id="logourl3"  value="<{$info.pic.2}>" class="div_input div_input02" >
                        <!--<input type="button" value="上传" class="div_file01 button_shangchuan03">-->
                        <!--隐藏-->
                        <div class="uploadimg"><input type="file" class="input_file03" name="uploadimg"  id="uploadimg3" onchange="uploadimgs(3)"></div>
                        <input type="button" value="预览"  data-id="3" class="div_file01 yulan">
                    </div>
                    <!--复制-->
                    <div class="div_01">
                        <span><span class="red">*</span>LBS坐标</span>
                        <span class="zuobiao01">经度（X）</span>
                        <input type="text" class="zuobiao02" id="longitude" name="longitude" <{if $info|@count neq 0 }>value="<{$info.longitude}>"<{/if}>>
                        <span class="zuobiao01">纬度（Y）</span>
                        <input type="text" class="zuobiao03" name="latitude" id="latitude" <{if $info|@count neq 0 }>value="<{$info.latitude}>"<{/if}>>
                        <input type="button" value="在地图中查看/设置" class="div_file01 button02" onclick="setlatlng($('#longitude').val(),$('#latitude').val())">
                        </div>
                    <!--复制-->
                    <div class="div_01 div_position">
                        <span class="first_span textarea_position">酒店简介</span>
                        <textarea type="text" name="intro1" id="content1" class="div_textarea"  ><{$info.intro1}></textarea>
                    </div>
                    <script>K.create("#content1",{height:"300px",cssPath:"<{$baseurl}>lib/kdeditor/plugins/code/prettify.css",uploadJson:"<{$baseurl}>lib/kdeditor/php/upload_json.php",fileManagerJson:"<{$baseurl}>lib/kdeditor/php/file_manager_json.php",allowFileManager:true,});
</script>
                    <!--复制-->
                    <div class="div_01 div_position">
                        <span class="first_span textarea_position">餐饮预订</span>
                        <textarea type="text" name="intro2" id="content2" class="div_textarea" ><{$info.intro2}></textarea>
                    </div>
                    <script>K.create("#content2",{height:"300px",cssPath:"<{$baseurl}>lib/kdeditor/plugins/code/prettify.css",uploadJson:"<{$baseurl}>lib/kdeditor/php/upload_json.php",fileManagerJson:"<{$baseurl}>lib/kdeditor/php/file_manager_json.php",allowFileManager:true,});
</script>
                    <!--复制-->
                    <div class="div_01 div_position">
                        <span class="first_span textarea_position">特价优惠</span>
                        <textarea type="text" name="intro3"  id="content3" class="div_textarea" ><{$info.intro3}></textarea>
                    </div>
    <script>K.create("#content3",{height:"300px",cssPath:"<{$baseurl}>lib/kdeditor/plugins/code/prettify.css",uploadJson:"<{$baseurl}>lib/kdeditor/php/upload_json.php",fileManagerJson:"<{$baseurl}>lib/kdeditor/php/file_manager_json.php",allowFileManager:true,});
</script>
                    <!--保存-->
                    <div class="baocunbox">
                        <input type="hidden" name="hid" value="<{$info.id}>" /><input type="submit" class="baocun" value="保存">
                    </div>
                </form>
                	 
                </div>
                
                
            </div>
        </div> 
        <!--选项站位-->
        <P class="zhanwei"></P>
       </div>
    </div>
   
</div>
<script>
function checkfrm(){
	if($("#name").val()=='' || $("#name").val()==null){
		alert("请填写酒店名称");
		return false;
	}else if($("#ename").val()=='' || $("#ename").val()==null){
		alert("请填写酒店英文名称");
		return false;
	}else if($("#address").val()=='' || $("#address").val()==null){
		alert("请填写酒店地址");
		return false;
	}else if($("#tel").val()=='' || $("#tel").val()==null){
		alert("请填写酒店电话");
		return false;
	}else if($("#longitude").val()=='' || $("#longitude").val()==null){
		alert("请选择酒店所处地图位置");
		return false;
	}else if($("#latitude").val()=='' || $("#latitude").val()==null){
		alert("请选择酒店所处地图位置");
		return false;
	}
}
function uploadimgs(n){
        var url = "<{$baseurl}>?g=user&m=member&a=uploadimg";
        $.ajaxFileUpload({
            url:url,
            dataType:'json',
            fileElementId:'uploadimg'+n,
            type:'post',
            secureuri:false,
            success:function(data){
                if(data.status==1){
					alert('上传成功');
                    $('#logourl'+n).val(data.msg);
                }else{
                    alert(data.msg);
                    return false;
                }
            },
        });
    };
</script>
<iframe width="0" height="0" name="hiddfrm" id="hiddfrm" scrolling="no" frameborder="0" style="display:none"></iframe>
</body>
</html>
